package com.servicebuck.database.entity;
// Generated Aug 30, 2011 11:09:02 PM by Hibernate Tools 3.4.0.CR1


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Cost generated by hbm2java
 */
@Entity
@Table(name="cost"
    ,catalog="telluricng"
)
public class Cost  implements java.io.Serializable {


     private long costId;
     private Currency currency;
     private Costtype costtype;
     private Date costStartDate;
     private Date costEndDate;
     private Integer inactive;
     private Set<Payment> payments = new HashSet<Payment>(0);

    public Cost() {
    }

	
    public Cost(long costId, Costtype costtype) {
        this.costId = costId;
        this.costtype = costtype;
    }
    public Cost(long costId, Currency currency, Costtype costtype, Date costStartDate, Date costEndDate, Integer inactive, Set<Payment> payments) {
       this.costId = costId;
       this.currency = currency;
       this.costtype = costtype;
       this.costStartDate = costStartDate;
       this.costEndDate = costEndDate;
       this.inactive = inactive;
       this.payments = payments;
    }
   
     @Id 

    
    @Column(name="cost_id", unique=true, nullable=false)
    public long getCostId() {
        return this.costId;
    }
    
    public void setCostId(long costId) {
        this.costId = costId;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="currency")
    public Currency getCurrency() {
        return this.currency;
    }
    
    public void setCurrency(Currency currency) {
        this.currency = currency;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="cost_type_id", nullable=false)
    public Costtype getCosttype() {
        return this.costtype;
    }
    
    public void setCosttype(Costtype costtype) {
        this.costtype = costtype;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="cost_start_date", length=19)
    public Date getCostStartDate() {
        return this.costStartDate;
    }
    
    public void setCostStartDate(Date costStartDate) {
        this.costStartDate = costStartDate;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="cost_end_date", length=19)
    public Date getCostEndDate() {
        return this.costEndDate;
    }
    
    public void setCostEndDate(Date costEndDate) {
        this.costEndDate = costEndDate;
    }

    
    @Column(name="inactive")
    public Integer getInactive() {
        return this.inactive;
    }
    
    public void setInactive(Integer inactive) {
        this.inactive = inactive;
    }

@ManyToMany(fetch=FetchType.LAZY)
    @JoinTable(name="costpaymentbridge", catalog="telluricng", joinColumns = { 
        @JoinColumn(name="cost_id", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="payment_id", nullable=false, updatable=false) })
    public Set<Payment> getPayments() {
        return this.payments;
    }
    
    public void setPayments(Set<Payment> payments) {
        this.payments = payments;
    }




}


